/**
 * Created by lemuelwang on 2017/2/22.
 */

qui(
    function (require, exports, module) {


        Director.Action = (function () {
            var editForm = null;
            var directorGrid = null;
            var editRun = function () {
                if (!editForm) {
                    editForm = new Director.Edit($.extend(true, {}, {}));
                }
                editForm.init();

                $("#effectTabs").tabs();
            };

            var libraryRun = function () {
                Ancestor.Config.EPG_AUTH.list = '/director/list';
                if (!directorGrid) {
                    directorGrid = new Director.Grid($.extend(true, {
                        '$container': $('#ProgramListContainer'),
                        $grid: $('#list')
                    }, {}));
                }
                directorGrid.runLibrary();
                console.log('library grid run');
            }

            return {
                editRun: editRun,
                libraryRun: libraryRun
            }
        })();
    }
);

